Claude: separate model discovery proxy - #395
Open
andy-xu-db wants to merge 9 commits into
Open
Conversation
andy-xu-db
force-pushed
the
andy.xu/claude-model-discovery-proxy
branch
from
August 26, 2026 02:04
0bb4d25 to
2ad807d
Compare
andy-xu-db
changed the base branch from
andy.xu/claude-gateway-model-aliases
to
main
August 26, 2026 02:04
lilly-luo
reviewed
Aug 26, 2026
| token_header: str, | ||
| force_refresh_near_expiry: bool, | ||
| ): | ||
| return gateway_proxy._start_proxy( |
Collaborator
There was a problem hiding this comment.
generally _ prefix is saved for private methods that aren't called outside of the file. can you use the public start_proxy instead? then you can override _start_proxy in the original gateway_proxy one and invoke it in the public start_proxy
lilly-luo
reviewed
Aug 26, 2026
| bytes_relayed = 0 | ||
| first_byte_ms: int | None = None | ||
| try: | ||
| transformed_body = self._transform_response(resp) |
Collaborator
There was a problem hiding this comment.
how can you transform the response if the req hasn't been sent yet?
lilly-luo
reviewed
Aug 26, 2026
Comment on lines
+332
to
+335
| response_chunks = ( | ||
| [transformed_body] if transformed_body is not None else resp.iter_raw() | ||
| ) | ||
| for chunk in response_chunks: |
Collaborator
There was a problem hiding this comment.
this was the cause of issues for relayed auth that customer reported, we should be careful changing this. also does this mean that if a relayed auth request is sent for inference on a session that has model discovery enabled, we wouldn't be doing resp.iter_raw?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Testing
uv run --frozen ruff check src/ tests/uv run --frozen ty check src/uv run --frozen pytest tests/test_gateway_proxy.py tests/test_anthropic_model_discovery_proxy.py tests/test_agent_claude.py tests/test_lint.py -quv run --frozen pytest -q --ignore=tests/test_e2e_user_agent.py(1951 passed, 37 skipped)Stacked on #375.